using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vkOedetMap : EntityTypeConfiguration<vkOedet>
    {
        public vkOedetMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Invoice_Number, t.Item_Number, t.Item_Quantity, t.Item_Cost, t.Item_Price_List, t.Item_Percentage_Discount, t.Surgeon_Amount, t.Anastesia_Doctor_Amount, t.Operating_Room_Amount, t.Amount_Lab_Item, t.Amount_Radiology_Item, t.Patient_amount, t.C1st_guarantor_amount, t.C2nd_guarantor_amount, t.item_discount, t.Invoice_Type, t.Item_Account });

            // Properties
            this.Property(t => t.Invoice_Number)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.Item_Number)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.LOCATION)
                .HasMaxLength(3);

            this.Property(t => t.User)
                .HasMaxLength(30);

            this.Property(t => t.Item_Type)
                .HasMaxLength(25);

            this.Property(t => t.Invoice_Type)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Invoice_Currency)
                .HasMaxLength(20);

            this.Property(t => t.First_Name)
                .HasMaxLength(50);

            this.Property(t => t.Last_Name)
                .HasMaxLength(50);

            this.Property(t => t.Father_Name)
                .HasMaxLength(50);

            this.Property(t => t.CITY)
                .HasMaxLength(30);

            this.Property(t => t.STATE)
                .HasMaxLength(3);

            this.Property(t => t.ZIP)
                .HasMaxLength(14);

            this.Property(t => t.PHONE)
                .HasMaxLength(19);

            this.Property(t => t.REGION)
                .HasMaxLength(5);

            this.Property(t => t.GENDER)
                .HasMaxLength(7);

            this.Property(t => t.Nationality)
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("vkOedet");
            this.Property(t => t.Invoice_Number).HasColumnName("Invoice Number");
            this.Property(t => t.Item_Number).HasColumnName("Item Number");
            this.Property(t => t.LOCATION).HasColumnName("LOCATION");
            this.Property(t => t.Item_Quantity).HasColumnName("Item Quantity");
            this.Property(t => t.Item_Cost).HasColumnName("Item Cost");
            this.Property(t => t.Item_Entry_Date).HasColumnName("Item Entry Date");
            this.Property(t => t.Item_Price_List).HasColumnName("Item Price List");
            this.Property(t => t.Item_Percentage_Discount).HasColumnName("Item Percentage Discount");
            this.Property(t => t.User).HasColumnName("User");
            this.Property(t => t.Surgeon_Amount).HasColumnName("Surgeon Amount");
            this.Property(t => t.Anastesia_Doctor_Amount).HasColumnName("Anastesia Doctor Amount");
            this.Property(t => t.Operating_Room_Amount).HasColumnName("Operating Room Amount");
            this.Property(t => t.Amount_Lab_Item).HasColumnName("Amount Lab Item");
            this.Property(t => t.Amount_Radiology_Item).HasColumnName("Amount Radiology Item");
            this.Property(t => t.Patient_amount).HasColumnName("Patient amount");
            this.Property(t => t.C1st_guarantor_amount).HasColumnName("1st guarantor amount");
            this.Property(t => t.C2nd_guarantor_amount).HasColumnName("2nd guarantor amount");
            this.Property(t => t.item_discount).HasColumnName("item discount");
            this.Property(t => t.Pathalogy_item_amount).HasColumnName("Pathalogy item amount");
            this.Property(t => t.Nuclear_item_amount).HasColumnName("Nuclear item amount");
            this.Property(t => t.Invoice_Date).HasColumnName("Invoice Date");
            this.Property(t => t.Invoice_Total_Cost).HasColumnName("Invoice Total Cost");
            this.Property(t => t.POSTED).HasColumnName("POSTED");
            this.Property(t => t.InvoiceTotal_Amount).HasColumnName("InvoiceTotal Amount");
            this.Property(t => t.Perc__Patient_pays).HasColumnName("Perc  Patient pays");
            this.Property(t => t.Perc_1st_Guar__pay).HasColumnName("Perc 1st Guar  pay");
            this.Property(t => t.Perc_2nd_Guar__pay).HasColumnName("Perc 2nd Guar  pay");
            this.Property(t => t.Perc_Patient_discount).HasColumnName("Perc Patient discount");
            this.Property(t => t.Total_Surgeon_amount).HasColumnName("Total Surgeon amount");
            this.Property(t => t.Total_Anastesia_amount).HasColumnName("Total Anastesia amount");
            this.Property(t => t.Total_Operating_Room_Amount).HasColumnName("Total Operating Room Amount");
            this.Property(t => t.Invoice_discount).HasColumnName("Invoice discount");
            this.Property(t => t.Item_Type).HasColumnName("Item Type");
            this.Property(t => t.Invoice_Type).HasColumnName("Invoice Type");
            this.Property(t => t.Invoice_Currency).HasColumnName("Invoice Currency");
            this.Property(t => t.Item_Account).HasColumnName("Item Account");
            this.Property(t => t.First_Name).HasColumnName("First Name");
            this.Property(t => t.Last_Name).HasColumnName("Last Name");
            this.Property(t => t.Father_Name).HasColumnName("Father Name");
            this.Property(t => t.CITY).HasColumnName("CITY");
            this.Property(t => t.STATE).HasColumnName("STATE");
            this.Property(t => t.ZIP).HasColumnName("ZIP");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.REGION).HasColumnName("REGION");
            this.Property(t => t.GENDER).HasColumnName("GENDER");
            this.Property(t => t.C2nd_Guarantor_pays_rest).HasColumnName("2nd Guarantor pays rest");
            this.Property(t => t.Patient_Price_List).HasColumnName("Patient Price List");
            this.Property(t => t.C1st_Guarantor_Price_List).HasColumnName("1st Guarantor Price List");
            this.Property(t => t.C2nd_Guarantor_Price_List).HasColumnName("2nd Guarantor Price List");
            this.Property(t => t.Entry_Date).HasColumnName("Entry Date");
            this.Property(t => t.Discharge_Date).HasColumnName("Discharge Date");
            this.Property(t => t.Nationality).HasColumnName("Nationality");
        }
    }
}
